// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'

export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/indexAnalysis',
    children: [
      {
        path: 'indexAnalysis',
        name: 'indexAnalysis',
        component: () => import('@/views/index/IndexAnalysis'),
        meta: { title: '首页', keepAlive: true, icon: 'star', permission: ['/indexAnalysis'] }
      },
      {
        path: 'test',
        name: 'test',
        component: () => import('@/views/blank/Blank'),
        meta: { title: 'ceshi', keepAlive: true, icon: 'star', permission: ['/system/ceshi'] }
      },
      {
        path: '/systemAdmin',
        redirect: '/systemAdmin/account',
        component: PageView,
        meta: { title: '系统管理', icon: 'setting', permission: ['/systemAdmin'] },
        children: [{
          path: 'account',
          name: 'account',
          component: () => import('@/views/systemAdmin/Account'),
          meta: { title: '用户管理', icon: 'android', keepAlive: true, permission: [ '/systemAdmin/account' ] }
        }, {
          path: 'userContractDep',
          name: 'userContractDep',
          component: () => import('@/views/systemAdmin/UserContractDep'),
          meta: { title: '员工-合同部门管理', icon: 'android', keepAlive: true, permission: [ '/systemAdmin/userContractDep' ] }
        }, {
          path: 'staff',
          name: 'staff',
          component: () => import('@/views/staffManage/StaffManage'),
          meta: { title: '员工管理', icon: 'android', keepAlive: true, permission: [ '/systemAdmin/staff' ] }
        }, {
          path: 'role',
          name: 'role',
          component: () => import('@/views/systemAdmin/Role'),
          meta: { title: '角色管理', icon: 'android', keepAlive: true, permission: [ '/systemAdmin/role' ] }
        }, {
          path: 'menu',
          name: 'menu',
          component: () => import('@/views/systemAdmin/Menu'),
          meta: { title: '菜单管理', icon: 'android', keepAlive: true, permission: [ '/systemAdmin/menu' ] }
        }]
      },
      {
        path: 'department',
        name: 'department',
        component: () => import('@/views/departManage/DepartManage'),
        meta: { title: '部门管理', keepAlive: true, icon: 'star', permission: ['/department'] }
      },
      {
        path: 'user',
        name: 'user',
        component: () => import('@/views/userManage/UserManage'),
        meta: { title: '账户管理', keepAlive: true, icon: 'star', permission: ['/user'] }
      },
      {
        path: 'code',
        name: 'code',
        component: () => import('@/views/codeManage/CodeManage'),
        meta: { title: '代码项管理', keepAlive: true, icon: 'star', permission: ['/code'] }
      },
      {
        path: '/dataManage',
        redirect: '/dataManage/contract',
        component: PageView,
        meta: { title: '数据管理', icon: 'database', permission: ['/dataManage'] },
        children: [{
          path: 'contract',
          name: 'dataManage-contract',
          component: () => import('@/views/dataManage/Contract'),
          meta: { title: '合同管理', keepAlive: true, permission: [ '/dataManage/contract' ] }
        }, {
          path: 'certificate',
          name: 'dataManage-certificate',
          component: () => import('@/views/dataManage/Certificate'),
          meta: { title: '证书管理', keepAlive: true, permission: [ '/dataManage/certificate' ] }
        }]
      },
      {
        path: '/statistics',
        redirect: '/statistics/contract',
        component: PageView,
        meta: { title: '统计管理', icon: 'filter', permission: ['/statistics'] },
        children: [{
          path: 'contract',
          name: 'statistics-contract',
          component: () => import('@/views/statistics/ContractStatistics'),
          meta: { title: '合同统计', keepAlive: true, permission: [ '/statistics/contract' ] }
        }, {
          path: 'certificate',
          name: 'statistics-certificate',
          component: () => import('@/views/statistics/CertificateStatistics'),
          meta: { title: '证书统计', keepAlive: true, permission: [ '/statistics/certificate' ] }
        }]
      },
      {
        path: '/leave',
        redirect: '/leave/statistics',
        component: PageView,
        meta: { title: '请假管理', icon: 'filter', permission: ['/leave'] },
        children: [{
          path: 'statistics',
          name: 'leave-statistics',
          component: () => import('@/views/leaveManage/Statistics'),
          meta: { title: '请假统计', keepAlive: true, permission: [ '/leave/statistics' ] }
        },
          {
            path: 'applyList',
            name: 'apply-list',
            component: () => import('@/views/leaveManage/ApplyList'),
            meta: { title: '我的申请', keepAlive: true, permission: [ '/leave/applyList' ] }
          },
          {
            path: 'approveList',
            name: 'approve-list',
            component: () => import('@/views/leaveManage/ApproveList'),
            meta: { title: '我的审批', keepAlive: true, permission: [ '/leave/approveList' ] }
          },
          {
            path: 'modelList',
            name: 'model-list',
            component: () => import('@/views/leaveManage/iframeBox'),
            meta: { title: '流程模型', keepAlive: true, permission: [ '/leave/modelList' ] }
          },
          {
            path: 'processModelList',
            name: 'process-model-list',
            component: () => import('@/views/leaveManage/iframeBox'),
            meta: { title: '已发布模型', keepAlive: true, permission: [ '/leave/processModelList' ] }
          },
          {
            path: 'applyManage',
            name: 'apply-manage',
            component: () => import('@/views/leaveManage/ApplyManage'),
            meta: { title: '请假申请管理', keepAlive: true, permission: [ '/leave/applyManage' ] }
          }]
      },
      {
        path: '/post',
        name: 'post',
        // redirect: '/post/list',
        component: () => import('@/views/post/list'),
        meta: { title: '公告管理', icon: 'filter', permission: ['/post'] }
        // children: [{
        //   path: 'list',
        //   name: 'post-list',
        //   component: () => import('@/views/post/list'),
        //   meta: { title: '公告管理列表', keepAlive: true, permission: [ '/post/list' ] }
        // }]
        }]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  {
    path: 'comingSoon',
    name: 'comingSoon',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/blank/ComingSoon')
  }

]
